package serv;

public class ThreadManager {
	
	private Connexion [] c;
	private Boolean [] f;
	private int nb_threads;
	
	public ThreadManager(int nbt){
		this.nb_threads = nbt;
		this.c = new Connexion[nbt];
		this.f = new Boolean[nbt];
		for (int i=0; i<nbt; i++){
			this.f[i] = true;
		}
	}

	public Connexion[] getConnexions (){
		return this.c;
	}
	
	public Boolean[] getF (){
		return this.f;
	}
	
	public Boolean isFree(int i){
		return f[i];
	}
	
	public void setFree(int i, Boolean b){
		this.f[i] = b;
	}
	
	public void minusNbThreads(){
		this.nb_threads = this.nb_threads - 1;
	}
	
	public void plusNbThreads(){
		this.nb_threads = this.nb_threads + 1;
	}
	
}
